﻿@model ExtremeEvents.Models.EditUtilizador

@{
    ViewBag.Title = "Edit";
}

<script type="text/javascript">
    //alterar estado dos botoes
    activarBotaoAreaCliente("conta"); //alterar para o nome da view
</script>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<div class="wrapper">
<div class="grid_4" style="width:98%;">
	<h3>A sua conta</h3>
	<div class="bg maxheight">
		<div class="content-indents">
            @using (Html.BeginForm())
            {
                @Html.ValidationSummary(true, "Error_22: Ocorreram erros ao alterar a conta. Por favor corrija os erros e tente de novo.")
                
                @Html.HiddenFor(m => m.guid)
                @Html.HiddenFor(m => m.Login)
                <h6 class="title1 p2-1">Conta:</h6>
                <table>
                    <tr>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.LabelFor(m => m.Login)</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.Login, new { disabled = true })
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.LabelFor(m => m.Email)</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.Email)
                                @Html.ValidationMessageFor(m => m.Email)
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.LabelFor(m => m.Password_Atual)</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.PasswordFor(m => m.Password_Atual)
                                @Html.ValidationMessageFor(m => m.Password_Atual)
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <div class="editor-label">
                                <h6 class="p1">@Html.LabelFor(m => m.Password_Nova)</h6>
                            </div>
                        </td>
                        <td>
                            <div class="editor-field">
                                @Html.PasswordFor(m => m.Password_Nova)
                                @Html.ValidationMessageFor(m => m.Password_Nova)
                            </div>
                        </td>
                    </tr>
                </table>
                <br />
                <h6 class="title1 p2-1">Dados Pessoais:</h6>
                <table>
                <tr>
                    <td align="right">
                        <div class="editor-label">
                            <h6 class="p1">@Html.LabelFor(m => m.Primeiro_Nome)</h6>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.TextBoxFor(m => m.Primeiro_Nome)
                        </div>
                    </td>
                    <td align="right" width="100">
                        <div class="editor-label">
                            <h6 class="p1">@Html.LabelFor(m => m.Ultimo_Nome)</h6>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.TextBoxFor(m => m.Ultimo_Nome)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <div class="editor-label">
                            <h6 class="p1">@Html.LabelFor(m => m.Nif)</h6>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.TextBoxFor(m => m.Nif)
                            @Html.ValidationMessageFor(m => m.Nif)
                        </div>
                    </td>
                    <td align="right">
                        <div class="editor-label">
                            <h6 class="p1">@Html.LabelFor(m => m.Genero)</h6>
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            @Html.RadioButtonFor(m => m.Genero, "Masculino") Masculino
                            @Html.RadioButtonFor(m => m.Genero, "Feminino") Feminino
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <div class="editor-label">
                            <h6 class="p1">@Html.LabelFor(m => m.Nome_Organizacao)</h6>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.TextBoxFor(m => m.Nome_Organizacao)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <div class="editor-label">
                            <h6 class="p1">@Html.LabelFor(m => m.Morada)</h6>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.TextBoxFor(m => m.Morada)
                        </div>
                    </td>
                    <td align="right">
                        <div class="editor-label">
                            <h6 class="p1">@Html.LabelFor(m => m.Numero)</h6>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.TextBoxFor(m => m.Numero)
                        </div>
                    </td>
                    <td align="right">
                        <div class="editor-label">
                            <h6 class="p1">@Html.LabelFor(m => m.Codigo_Postal)</h6>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.TextBoxFor(m => m.Codigo_Postal)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <div class="editor-label">
                            <h6 class="p1">@Html.LabelFor(m => m.Distrito)</h6>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.TextBoxFor(m => m.Distrito)
                        </div>
                    </td>
                    <td align="right">
                        <div class="editor-label">
                            <h6 class="p1">@Html.LabelFor(m => m.Concelho)</h6>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.TextBoxFor(m => m.Concelho)
                        </div>
                    </td>
                    <td align="right" width="100">
                        <div class="editor-label">
                            <h6 class="p1">@Html.LabelFor(m => m.Freguesia)</h6>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.TextBoxFor(m => m.Freguesia)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <div class="editor-label">
                            <h6 class="p1">@Html.LabelFor(m => m.Pais)</h6>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.DropDownListFor(m => m.Pais, new SelectList(new Dictionary<string, string> { { "Portugal", "Portugal" }, { "Outro", "Outro" } }, "Key", "Value"))
                        </div>
                    </td>
                </tr>
            </table>
            }
        </div>
    </div>
</div>
</div>

<br />
<div style="padding:10px;">
<table width="100%">
<tr>
<td>
<a href="@Url.Action("DesativarConta", "Utilizador")" class="button"><span>desativar conta</span></a>
</td>
<td align="right">
<a href="@Url.Action("Index", "Utilizador")" class="button"><span>cancelar</span></a>
<a href="javascript:$('form')[0].submit();" class="button"><span>alterar</span></a>
</td>
</tr>
</table>
</div>